package com.restcloud.pojo.Public;

import lombok.Data;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import java.util.List;

@XmlAccessorType(XmlAccessType.FIELD)
@Data
public class Id {

    public Id() {
    }

    public Id(String root, String extension) {
        this.root = root;
        if (!extension.equals("")){
            this.extension = extension;
        }
    }

    public Id(Id item) {
        this.item = item;
    }

    public Id(List<Value> part) {
        this.part = part;
    }

    @XmlAttribute(name = "root")
    private String root;

    @XmlAttribute(name = "extension")
    private String extension;

    @XmlAttribute(name = "displayable")
    private String displayable;

    @XmlElement(name = "item")
    private Id item;

    @XmlElement(name = "queryId")
    private Id queryId;

    @XmlElement(name = "queryResponseCode")
    private Code queryResponseCode;

    @XmlElement(name = "part")
    private List<Value> part;

    public String getRoot() {
        return root;
    }

    public void setRoot(String root) {
        this.root = root;
    }

    public String getExtension() {
        return extension;
    }

    public void setExtension(String extension) {
        this.extension = extension;
    }

    public String getDisplayable() {
        return displayable;
    }

    public void setDisplayable(String displayable) {
        this.displayable = displayable;
    }

    public Id getItem() {
        return item;
    }

    public void setItem(Id item) {
        this.item = item;
    }

    public Id getQueryId() {
        return queryId;
    }

    public void setQueryId(Id queryId) {
        this.queryId = queryId;
    }

    public Code getQueryResponseCode() {
        return queryResponseCode;
    }

    public void setQueryResponseCode(Code queryResponseCode) {
        this.queryResponseCode = queryResponseCode;
    }

    public List<Value> getPart() {
        return part;
    }

    public void setPart(List<Value> part) {
        this.part = part;
    }
}
